import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:top_foundation/component/carousel_text.dart';
import 'package:top_foundation/component/horse_race_lamp.dart';
import 'package:top_foundation/utils/util.dart';

import 'index.dart';
import 'widgets/widgets.dart';

class HorseRaceLampPage extends GetView<HorseRaceLampController> {
  const HorseRaceLampPage({Key? key}) : super(key: key);

  // 主视图
  Widget _buildView() {
    return Column(
      children: [
        Marquee(
          child: Text('我是一个跑马灯，哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈'),
        ),
        SizedBox(height: 80.r),
        CarouselText(
          list: List.generate(6, (index) => '我是第$index条'),
          height: 50,
          color: Colors.amber,
        ),
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<HorseRaceLampController>(
      builder: (_) {
        return Scaffold(
          appBar: AppBar(title: const Text("horse_race_lamp")),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
